<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="../common/common.jsp"%>
<link rel="stylesheet" href="${ctx}/page/topic/css/createTopic.css" />
<script type="text/javascript" src="${ctx}/page/topic/js/updateTopic.js"></script>

<title>修改话题</title>
</head>
<body>
	<div class="wrapper">
		<%@ include file="../common/header.jsp"%>
		<div class="container">
			<div class="row">
				<div class="col-md-9">
					<div class="panel panel-default">
						<div class="panel-heading">
							 修改话题
						</div>
						<div class="panel-body">
							<form method="post" action="${ctx}/topic/updateTopic" id="topicForm">
								<div class="form-group">
									<label for="title">标题</label>
									 <input type="text" disabled class="form-control" id="title" name="title" value="${topic.title}">
								</div>
								<div class="form-group">
									<label for="summary">摘要</label>
									 <input type="text" class="form-control" id="summary" name="summary" value="${topic.summary}">
								</div>
								<div class="form-group">
									<label for="title">内容</label>
									<textarea name="content" id="content" rows="15"	class="form-control">${topic.content}</textarea>
								</div>
								<div class="form-group">
									<label for="title">版块</label> 
									<select name="sectionId" id="sectionId" class="form-control">
										<option value="${topic.section.id}">${topic.section.name}</option>
									</select>
								</div>
								<input type="hidden" class="form-control" id="topicId" name="topicId" value="${topic.id}">
								<button type="button" onclick="updateTopic();" class="btn btn-default">确定</button>
								<span id="error_message"></span>
							</form>
						</div>
					</div>
				</div>

				<div class="col-md-3 hidden-sm hidden-xs">
					<%@ include file="../include/adviertisement.jsp"%>
				</div>
			</div>
		</div>
		<%@ include file="../common/footer.jsp"%>
	</div>
	<link rel="stylesheet" href="${ctx}/static/libs/editor/editor.css" />
	<script type="text/javascript" src="${ctx}/static/js/lodash.min.js"></script>
	<script type="text/javascript" src="${ctx}/static/libs/webuploader/webuploader.withoutimage.js"></script>
	<script type="text/javascript" src="${ctx}/static/libs/markdownit.js"></script>
	<script type="text/javascript" src="${ctx}/static/libs/editor/editor.js"></script>
	<script type="text/javascript" src="${ctx}/static/libs/editor/ext.js"></script>
	<script type="text/javascript">
		var editor = new Editor({
			element : $("#content")[0],
			status : []
		});
		editor.render();
	</script>
</body>
</html>